
//点击手机号注册
var dj = document.querySelector(".sjh");
var dj1 = document.querySelector(".bt1");
var dj2 = document.querySelector(".right");
var dj3 = document.querySelector(".cwa img");
var dj4 = document.querySelector(".cwb img");


dj.addEventListener("focus",function(){
		dj1.style.display = "block";
})

dj.addEventListener("blur",function(){
	if(this.value !== ""){
		dj1.style.display = "block";
	}else{
		dj1.style.display = "none";
	}
})


//注册倒计时
var countdown=60;
var zm = document.querySelector(".dxyzm")
function settime(val) {
    if(countdown == 0) {
    	val.removeAttribute("disabled");
    	val.value = "免费获取验证码";
    	countdown = 60;
   	} else {
    	val.setAttribute("disabled", true);
   		val.value = "重新发送(" + countdown + ")";
    	countdown--;
    	setTimeout(function() {
   			settime(val)
   		}, 1000)
   	}
   	if(countdown == 52) {
   		zm.value = "534675";
   	}
}


//注册账号密码为空
var cw1 = document.querySelector(".cw1")
var cw11 = document.querySelector(".cw11")
var cw2 = document.querySelector(".cw2")
var cw22 = document.querySelector(".cw22")
cw11.addEventListener("blur",function(){
	if(this.value !== ""){
		cw11.style.border = "1px solid #aaa"
		cw1.style.height = "0";
		dj3.style.display = "block";
	}else{
		cw1.style.height = "24px";
		dj3.style.display = "none";
		cw11.style.border = "1px solid #ed6661"
	}
})
cw22.addEventListener("blur",function(){
	if(this.value.length >= 8 && this.value.length <=16){
		cw22.style.border = "1px solid #aaa"
		dj4.style.display = "block";
		cw2.style.height = "0";
	}else{
		dj4.style.display = "none";
		cw2.style.height = "24px";
		cw22.style.border = "1px solid #ed6661"
	}
})